import config from "./config"
const http = (option={})=>{
  return new Promise((resolve, reject) => {
    wx.request({
        url: config.baseUrl + option.url,
        data: option.data || {},
        header: option.header || {
          "content-type":  'application/x-www-form-urlencoded'
        },
        method: option.method || "POST",
           success: res => {
               resolve(res);
           },
           fail: res => {
               resolve(res);
        },
   });
});
}
export default http